<?php

class page_header
{
	var $title;
	var $subtitle;
	var $logo1;
	var $logo2;
	var $id; //id of the mode

	function page_header($data, $title_field, $subtitle_field, $logo1_field, $logo2_field, $custom_subtitle='')
	{
		$this->data = $data;
		
		$this->title = $data[$title_field];
		$this->logo1 = $logo1_field == '' ? '' : $data[$logo1_field];
		$this->logo2 = $logo2_field == '' ? '' : $data[$logo2_field];
		if($custom_subtitle == '')
		{
			$this->subtitle = $data[$subtitle_field];
		}
		else
		{
			$this->subtitle = $custom_subtitle;
		}
	}
	
	function render()
	{
		global $skin_dir;
		
		$title = $this->title;
		$subtitle = $this->subtitle;
		$logo1 = $this->logo1 == '' ? '' : '<img src="' . $this->logo1 . '"/>';
		$logo2 = $this->logo2 == '' ? '' : '<img src="' . $this->logo2 . '"/>';
		
		include $skin_dir . 'tpl/pageHeader.tpl';
	}
	
}

?>